Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Editing Shape Geometries


GXCountShapePoints

You can use the GXCountShapePoints function to determine the number of geometric points in a specific contour of a shape.

long GXCountShapePoints(gxShape source, long contour);
source
A reference to the shape containing the contour.
contour
The index of the contour whose geometric points you want to count.
function result
The number of points in the specified contour of the source shape.
DESCRIPTION
The GXCountShapePoints function returns as its function result the number of points in the contour specified by the contour parameter of the shape specified by the source parameter. If you pass 0 for the contour parameter, this function returns the total number of geometric points in the shape.

For the geometric shapes with only one contour--points, lines, curves, and rectangles-- you must pass a 0 or a 1 in the contour parameter. For polygons and paths shapes, the value you provide for the contour parameter must be 0 or greater and must be equal to or less than the actual number of contours in the shape. For empty and full shapes, the function posts a contour_out_of_range warning.

If you provide a source shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape typeAction taken
bitmapReturns 1 if the contour parameter is 0 or 1; posts the error contour_out_of_range otherwise
picturePosts the error graphic_type_does_not_contain_points
textReturns 1 if the contour parameter is 0 or 1; posts the error contour_out_of_range otherwise
glyphReturns the number of glyphs in the style run indicated by the contour parameter
layoutReturns the byte length of the style run indicated by the contour parameter

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
graphic_type_does_not_contain_points(debugging version)
Warnings 
contour_out_of_range 
SEE ALSO
For a discussion of geometric points, see the section "About Geometric Shapes" beginning on page 2-5.

To learn how this function works for typographic shape types, see Inside Macintosh: QuickDraw GX Typography.

To determine the number of contours in a shape, use the GXCountShapeContours function, which is described on page 2-136.

To determine the index of a particular geometric point within a shape, use the GXGetShapeIndex function, which is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help